/**
 * 
 */
package com.yerba.ricecooker.chart;

import java.util.ArrayList;

import com.yerba.ricecooker.utility.DataSet;

/**
 * @author mxie
 * 
 */
public class AnnotatedTimeLineDataSet
{
    public AnnotatedTimeLineDataSet(int numberOfLines)
    {
        clear();
        setNumberOfLines(numberOfLines);
    }

    DataSet<String, AnnotatedTimeLineDataRow> dataset = new DataSet<String, AnnotatedTimeLineDataRow>();
    int numberOfLines = 0;
    ArrayList<String> labels = new ArrayList<String>();

    public ArrayList<String> getLabels()
    {
        return labels;
    }

    public void setLabels(ArrayList<String> labels)
    {
        this.labels = labels;
    }

    public DataSet<String, AnnotatedTimeLineDataRow> getDataset()
    {
        return dataset;
    }

    public void setDataset(DataSet<String, AnnotatedTimeLineDataRow> dataset)
    {
        this.dataset = dataset;
    }

    public int getNumberOfLines()
    {
        return numberOfLines;
    }

    public void setNumberOfLines(int numberOfLines)
    {
        this.numberOfLines = numberOfLines;
    }

    public void addDataRow(AnnotatedTimeLineDataRow datarow)
    {
        getDataset().append(datarow.getDate(), datarow);
    }

    public AnnotatedTimeLineDataRow get(int index)
    {
        return getDataset().getData(index);
    }

    public AnnotatedTimeLineDataRow get(String key)
    {
        return getDataset().getData(key);
    }

    public int size()
    {
        return getDataset().getSize();
    }

    public void clear()
    {
        setNumberOfLines(0);
        getLabels().clear();
        getDataset().clear();
    }
}
